<template>
	<view>
		<view style="display: flex;justify-content: space-between;align-items: center;flex-wrap:wrap;width: 100%;">
			<view v-for="(item,index) in list" :key="index" style="margin-bottom: 20rpx;width: 49%;"
				@click="goCard('/pages/sub/store/detail?id='+item.id)">
				<view>
					<image :src="item.image"
						style="width:348rpx;height: 348rpx;display: block;border-radius:20rpx 20rpx 0 0;"></image>
					<view style="padding: 20rpx 0 20rpx 20rpx;border-radius: 0 0 12rpx 12rpx;position:relative;" :style="{backgroundColor:bgcolor}">
						<view
							style="color: #000;font-size: 28rpx;width:100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;font-weight: 700;">
							{{item.title}}</view>
						<view style="display: flex;align-items: center;margin: 8rpx 0;">
							<view style="font-size: 32rpx;color: #000;margin-right: 14rpx;font-weight: 650;"><text style="font-size: 24rpx;">¥</text>{{parseFloat(item.price).toFixed(2)}}</view>
							<view style='display: flex;align-items: center;font-size: 20rpx;'>
								<text style="color: #a9a9a9;">7日销量</text><text
									style="margin: 0 4rpx;"></text><text style="color:#a9a9a9">{{item.sales}}</text>
							</view>
						</view>
						<view style="display: flex;align-items: center;justify-content: space-between;">
							<view>
								<view style="font-size: 22rpx;color:#FF7B50;">高佣</view>
								<view style="display:flex;justify-content: space-between;align-items: center;">
									<view style="color: #FF3F3F;font-size: 32rpx;font-weight: 600;">55%</view>
									<view style="color:#aaa;font-size: 24rpx;margin-left: 12rpx;">50%</view>
								</view>
							</view>
							<view style="color:#FF7B50;font-size: 22rpx;padding:4rpx 16rpx;border-radius: 20rpx 0 0 20rpx;background-color:rgba(255, 122, 0, 0.10);right: 0;position: absolute;">1025 人哔滴</view>
						</view>
						<view style="display: flex;align-items: center;margin-top: 20rpx;">
							<image :src="item.avatar" mode="" style="width:44rpx;height: 44rpx;border-radius: 50%;"></image>
							<view style="font-size: 24rpx;font-weight: 600;margin-left: 10rpx;">{{item.name}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view style="padding: 0 130rpx;">
			<u-divider :text="params.loadTxt" textColor="#b8b8b8" lineColor="#b8b8b8"></u-divider>
		</view>
	</view>
</template>

<script>
	import {
		goNav
	} from '@/lib/Comment.js'
	export default {
		props: {
			list: {
				type: Array,
				default () {
					return []
				}
			},
			params: {
				type: Object,
				default: () => {}
			},
			bgcolor: {
				type: String,
				default: "#fff"
			}
		},
		data() {
			return {

			}
		},
		methods: {
			showTow(text) {
				uni.showToast({
					icon: 'none',
					title: text
				})
			},
			goCard(url, appid) {
				if (appid) {
					uni.navigateToMiniProgram({
						appId: appid,
						path: url,
						envVersion: 'release'
					})
				} else {
					goNav(url)
				}

			},
		}
	}
</script>

<style>
</style>